﻿using System;
using Microsoft.ReportingServices.DataProcessing;
using System.Management.Automation;

namespace PowerShellDataProcessingExtension
{
    /// <summary>
    /// Represents a parameter or name/value pair that is passed to a command or query.
    /// </summary>
    class PSDataParameter : IDataParameter
    {
        private String parameterName;
        private Object value;

        /// <summary>
        /// Initializes a new instance of the DataParameter class.
        /// </summary>
        public PSDataParameter() { }

        /// <summary>
        /// Initializes a new instance of the DataParameter class with the parameter name and an object that is the value of the parameter.
        /// </summary>
        /// <param name="parameterName"></param>
        /// <param name="value"></param>
        public PSDataParameter(String parameterName, Object value)
        {
            this.parameterName = parameterName;
            this.value = value;
        }

        /// <summary>
        /// Gets or sets the name of the IDataParameter
        /// </summary>
        public String ParameterName
        {
            get
            {
                return this.parameterName;
            }
            set
            {
                this.parameterName = value;
            }
        }

        /// <summary>
        /// Gets or sets the value of the parameter
        /// </summary>
        public Object Value
        {
            get
            {
                return this.value;
            }
            set
            {
                this.value = value;
            }
        }
    }
}
